#include <bits/stdc++.h>
#ifndef DEBUG
#define debug
#endif
using namespace std;

void solve() {
  string str;
  getline(cin, str);
  stack<char> ops;
  stringstream ss(str);
  string token;
  vector<string> tokens;
  int priority[128];
  priority['+'] = 1;
  priority['-'] = 1;
  priority['*'] = 2;
  priority['/'] = 2;
  auto cmp = [&](int top, int cur) {
    return priority[top] >= priority[cur];
  };
  while (ss >> token) {
    if (isdigit(token[0])) {
      tokens.emplace_back(token);
    } else {
      while (!ops.empty() && cmp(ops.top(), token[0])) {
        tokens.emplace_back(string(1, ops.top()));
        ops.pop();
      }
      ops.push(token[0]);
    }
  }
  while (!ops.empty()) {
    tokens.emplace_back(string(1, ops.top()));
    ops.pop();
  }

  stack<double> nums;
  auto calc = [&](char op) {
    double b = nums.top(); nums.pop();
    double a = nums.top(); nums.pop();
    if (op == '+') return a + b;
    if (op == '-') return a - b;
    if (op == '*') return a * b;
    return a / b;
  };
  for (auto token : tokens) {
    if (isdigit(token[0])) {
      nums.push(stod(token));
    } else {
      nums.push(calc(token[0]));
    }
  }
  cout << fixed << setprecision(2);
  cout << nums.top() << endl;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  solve();
  // for (int cas = 1; cas <= 50; cas ++) {
  //   freopen(format("data/data{:03}.in", cas).c_str(), "r", stdin);
  //   freopen(format("data/data{:03}.out", cas).c_str(), "w", stdout);
  //   solve();
  //   fclose(stdin);
  //   fclose(stdout);
  // }
}